<template>
	<view class="myApply">
		<view class="myApplyBox" v-for="item in data" :key="item.id">
			<view class="title">
				{{item.name}}
			</view>
			<u-grid :border="false" col="4">
				<u-grid-item v-for="(listItem,listIndex) in item.flow_type_list" :key="listIndex" @click="swich(listItem)">
					<u-icon :customStyle="{paddingTop:10+'rpx'}" name="star" color="#0062AD" size="66"></u-icon>
					<text class="grid-text">{{listItem.name}}</text>
				</u-grid-item>
			</u-grid>
		</view>
    <view style="text-align: center;padding-top: 100rpx;" v-if="data.length == 0">
      <image src="@/static/img/nullData.png" style="width: 160px;height: 160px;"></image>
      <view>暂无数据</view>
    </view>
	</view>
</template>

<script>
	import {
		getFlowTree
	} from "../../api/flow.js"

	export default {
		data() {
			return {
				data: []
			}
		},
		created() {
			this.getFlowType()
		},
		methods: {
			async getFlowType() {
				const {
					data
				} = await getFlowTree({
					is_show: 1
				})
				this.data = data.data
			},
			swich(item) {
				uni.navigateTo({
						url: `/pages/manage/leave?id=${item.id}`
						 // url:`/pages/manage/leave/leave?obj=${JSON.stringify(item)}`
					});
			}
		}
	}
</script>

<style lang="scss">
	.swiper {
		height: 240rpx;
	}

	.grid-text {
		font-size: 14px;
		color: #909399;
		padding: 10rpx 0 20rpx 0rpx;
		/* #ifndef APP-PLUS */
		box-sizing: border-box;
		/* #endif */
	}

	.myApply {
		height: 100%;
		.myApplyBox {
			background-color: #fff;
			margin-top: 20rpx;
			.title {
				width: 95%;
				margin: 0 auto;
				padding: 20rpx 0;
				font-weight: bold;
				font-size: 32rpx;
				background-color: rgba(249, 249, 249, 1);
			}
		}
	}
</style>
